/*
 * @Author: mayijun
 * @Date: 2022-05-10 17:17:34
 * @LastEditors: mayijun
 * @LastEditTime: 2022-05-12 10:19:31
 */
import Mock from 'mockjs';
//@ts-ignore
Mock.XHR.prototype._original_send = Mock.XHR.prototype.send;
//@ts-ignore
Mock.XHR.prototype.send = function () {
  if (this.custom.xhr) {
    this.custom.xhr.responseType = this.responseType || '';
    //@ts-ignore
    Mock.XHR.prototype.upload = this.custom.xhr.upload;
  }
  this._original_send(...arguments);
}

// Mock配置
Mock.setup({
  timeout: '200-600' // 响应时间
});
// 是否启用ums的mock
import './ums';
export default Mock;
